package enumAndAnnotation;

/**
 * 枚举类练习
 */
public class EnumExercise01 {

    public static void main(String[] args) {

        /*
            1)声明 Week 枚举类，其中包含星期一至星期日的定义：MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY,SUNDAY
            2)使用 values 返回所有枚举数组并遍历
         */

        Week[] weeks = Week.values();
        System.out.println("====所有星期的信息如下====");
        for (Week week : weeks) {
            System.out.println(week);
        }
    }
}

enum Week{

    MONDAY("星期一"),TUESDAY("星期二"),WEDNESDAY("星期三"),THURSDAY("星期四"),
    FRIDAY("星期五"),SATURDAY("星期六"),SUNDAY("星期日");

    private String name;

    private Week(String name) {

    }

    @Override
    public String toString() {
        return "Week{" +
                "name='" + name + '\'' +
                '}';
    }
}